<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Class: Spec::DSL::Example</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Class</strong></td>
          <td class="class-name-in-header">Spec::DSL::Example</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../../../files/vendor/plugins/rspec/lib/spec/dsl/example_rb.html">
                vendor/plugins/rspec/lib/spec/dsl/example.rb
                </a>
        <br />
            </td>
        </tr>

        <tr class="top-aligned-row">
            <td><strong>Parent:</strong></td>
            <td>
                <a href="../../Object.html">
                Object
               </a>
            </td>
        </tr>
        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">



   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M000335">description</a>&nbsp;&nbsp;
      <a href="#M000334">matches?</a>&nbsp;&nbsp;
      <a href="#M000332">new</a>&nbsp;&nbsp;
      <a href="#M000333">run</a>&nbsp;&nbsp;
      <a href="#M000336">to_s</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->

    <div id="section">





    <div id="attribute-list">
      <h3 class="section-bar">Attributes</h3>

      <div class="name-list">
        <table>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">number</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc">
The global sequence number of this example

</td>
        </tr>
        </table>
      </div>
    </div>
      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Class methods</h3>

      <div id="method-M000332" class="method-detail">
        <a name="M000332"></a>

        <div class="method-heading">
          <a href="#M000332" class="method-signature">
          <span class="method-name">new</span><span class="method-args">(description, options={}, &amp;example_block)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000332-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000332-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/dsl/example.rb, line 9</span>
 9:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">description</span>, <span class="ruby-identifier">options</span>={}, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">example_block</span>)
10:         <span class="ruby-ivar">@from</span> = <span class="ruby-identifier">caller</span>(<span class="ruby-value">0</span>)[<span class="ruby-value">3</span>]
11:         <span class="ruby-ivar">@options</span> = <span class="ruby-identifier">options</span>
12:         <span class="ruby-ivar">@example_block</span> = <span class="ruby-identifier">example_block</span>
13:         <span class="ruby-ivar">@description</span> = <span class="ruby-identifier">description</span>
14:         <span class="ruby-ivar">@description_generated_proc</span> = <span class="ruby-identifier">lambda</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">desc</span><span class="ruby-operator">|</span> <span class="ruby-ivar">@generated_description</span> = <span class="ruby-identifier">desc</span> }
15:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M000335" class="method-detail">
        <a name="M000335"></a>

        <div class="method-heading">
          <a href="#M000335" class="method-signature">
          <span class="method-name">description</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000335-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000335-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/dsl/example.rb, line 40</span>
40:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">description</span>
41:         <span class="ruby-ivar">@description</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:__generate_description</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">generated_description</span> <span class="ruby-operator">:</span> <span class="ruby-ivar">@description</span>
42:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000334" class="method-detail">
        <a name="M000334"></a>

        <div class="method-heading">
          <a href="#M000334" class="method-signature">
          <span class="method-name">matches?</span><span class="method-args">(matcher, specified_examples)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000334-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000334-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/dsl/example.rb, line 35</span>
35:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">matches?</span>(<span class="ruby-identifier">matcher</span>, <span class="ruby-identifier">specified_examples</span>)
36:         <span class="ruby-identifier">matcher</span>.<span class="ruby-identifier">example_desc</span> = <span class="ruby-identifier">description</span>
37:         <span class="ruby-identifier">matcher</span>.<span class="ruby-identifier">matches?</span>(<span class="ruby-identifier">specified_examples</span>)
38:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000333" class="method-detail">
        <a name="M000333"></a>

        <div class="method-heading">
          <a href="#M000333" class="method-signature">
          <span class="method-name">run</span><span class="method-args">(reporter, before_each_block, after_each_block, dry_run, execution_context, timeout=nil)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000333-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000333-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/dsl/example.rb, line 17</span>
17:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">run</span>(<span class="ruby-identifier">reporter</span>, <span class="ruby-identifier">before_each_block</span>, <span class="ruby-identifier">after_each_block</span>, <span class="ruby-identifier">dry_run</span>, <span class="ruby-identifier">execution_context</span>, <span class="ruby-identifier">timeout</span>=<span class="ruby-keyword kw">nil</span>)
18:         <span class="ruby-ivar">@dry_run</span> = <span class="ruby-identifier">dry_run</span>
19:         <span class="ruby-identifier">reporter</span>.<span class="ruby-identifier">example_started</span>(<span class="ruby-keyword kw">self</span>)
20:         <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">reporter</span>.<span class="ruby-identifier">example_finished</span>(<span class="ruby-keyword kw">self</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">dry_run</span>
21: 
22:         <span class="ruby-identifier">errors</span> = []
23:         <span class="ruby-identifier">location</span> = <span class="ruby-keyword kw">nil</span>
24:         <span class="ruby-constant">Timeout</span>.<span class="ruby-identifier">timeout</span>(<span class="ruby-identifier">timeout</span>) <span class="ruby-keyword kw">do</span>
25:           <span class="ruby-identifier">before_each_ok</span> = <span class="ruby-identifier">before_example</span>(<span class="ruby-identifier">execution_context</span>, <span class="ruby-identifier">errors</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">before_each_block</span>)
26:           <span class="ruby-identifier">example_ok</span> = <span class="ruby-identifier">run_example</span>(<span class="ruby-identifier">execution_context</span>, <span class="ruby-identifier">errors</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">before_each_ok</span>
27:           <span class="ruby-identifier">after_each_ok</span> = <span class="ruby-identifier">after_example</span>(<span class="ruby-identifier">execution_context</span>, <span class="ruby-identifier">errors</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">after_each_block</span>)
28:           <span class="ruby-identifier">location</span> = <span class="ruby-identifier">failure_location</span>(<span class="ruby-identifier">before_each_ok</span>, <span class="ruby-identifier">example_ok</span>, <span class="ruby-identifier">after_each_ok</span>)
29:         <span class="ruby-keyword kw">end</span>
30: 
31:         <span class="ruby-constant">ExampleShouldRaiseHandler</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@from</span>, <span class="ruby-ivar">@options</span>).<span class="ruby-identifier">handle</span>(<span class="ruby-identifier">errors</span>)
32:         <span class="ruby-identifier">reporter</span>.<span class="ruby-identifier">example_finished</span>(<span class="ruby-keyword kw">self</span>, <span class="ruby-identifier">errors</span>.<span class="ruby-identifier">first</span>, <span class="ruby-identifier">location</span>, <span class="ruby-ivar">@example_block</span>.<span class="ruby-identifier">nil?</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">reporter</span>
33:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000336" class="method-detail">
        <a name="M000336"></a>

        <div class="method-heading">
          <a href="#M000336" class="method-signature">
          <span class="method-name">to_s</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000336-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000336-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/dsl/example.rb, line 44</span>
44:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_s</span>
45:         <span class="ruby-identifier">description</span>
46:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>